package cn.iocoder.yudao.module.promotion.enums;

import java.util.Arrays;
import java.util.Optional;



public enum PrizeDrawSettingTypeEnum {
    // 获得抽奖次数方式
    DRAGON_BEANS("1", "龙豆兑换"),
    INVITING("2", "邀新"),
    SIGN("3", "连续签到"),
    GOODS("4", "商城下单"),
    WRITEOFF("5", "预约试驾核销"),
    ;

    private final String code;
    private final String message;

    PrizeDrawSettingTypeEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public static String getDescByValue(String code) {
        Optional<PrizeDrawSettingTypeEnum> optional = Arrays.stream(values()).filter(e -> e.code.equals(code)).findFirst();
        return optional.isPresent() ? optional.get().message : "未知错误";
    }

    public String getCode() {
        return code;
    }

    public String getMsg() {
        return message;
    }
}